spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1import { bestMw, fmtMw, placeLine } from "@/lib/format";2import { STATUS_LABEL, TYPE_LABEL } from "@/lib/labels";3import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";4import { getFacility, mwIsEstimate } from "./data";56export const alt = "Data center profile on DataCenterIndex";7export const size = OG_SIZE;8export const contentType = OG_CONTENT_TYPE;9export const revalidate = 3600;1011export default async function Image({ params }: { params: Promise<{ slug: string }> }) {12 const { slug } = await params;13 const r = await getFacility(slug);14 if (!r.ok) return renderOg({ eyebrow: "Data center", title: "DataCenterIndex", subtitle: "The global index of data center infrastructure." });15 const f = r.data;16 const { mw, kind } = bestMw(f);17 const mwLabel = kind === "it" ? "IT capacity" : kind === "total" ? "Total power" : kind === "planned" ? "Planned power" : "Capacity";18 return renderOg({19 eyebrow: "Data center",20 title: f.name,21 subtitle: [f.operator?.name, placeLine(f)].filter((s) => s && s !== "—").join(" · "),22 stats: [23 { label: mwLabel, value: mw === null ? "—" : `${mwIsEstimate(f) || kind === "planned" ? "≈ " : ""}${fmtMw(mw)}` },24 { label: "Status", value: STATUS_LABEL[f.status] },25 { label: "Type", value: TYPE_LABEL[f.facilityType] },26 { label: "Country", value: f.countryName ?? f.countryIso2 ?? "—" },27 ],28 });29}30